﻿CREATE TABLE [dbo].[User] (
    [Id]                INT           IDENTITY (1, 1) NOT NULL,
    [OpenId]            NVARCHAR (50) NOT NULL,
    [SubscribeDt]       DATETIME      NULL,
    [UnsubscribeDt]     DATETIME      NULL,
    [LastActiveDt]      DATETIME      NULL,
    [IsBitcareMember]   BIT           DEFAULT ((0)) NOT NULL,
    [BitcareMemberName] NVARCHAR (50) NULL,
    [RecStatus]         INT           NOT NULL,
    [RecCreateDt]       DATETIME      NOT NULL,
    [RecUpdateDt]       DATETIME      NULL,
    [RecDeleteDt]       DATETIME      NULL,
    [BitcareMemberId]   BIGINT        NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'用户表', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'主键，自增长', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'Id';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'微信用户OpenId', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'OpenId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订阅时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'SubscribeDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'退订时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'UnsubscribeDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'最近活跃时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'LastActiveDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否已绑定倍康会员', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'IsBitcareMember';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'倍康会员用户名', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'BitcareMemberName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录状态, 1：正常；2：删除', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'RecStatus';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录创建时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'RecCreateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录上次修改时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'RecUpdateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录删除时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'User', @level2type = N'COLUMN', @level2name = N'RecDeleteDt';

